
import {Column, Entity, PrimaryGeneratedColumn} from "typeorm";
import { AutoTradeType } from '../../trader/types';

@Entity()
export default class AutoOrderHistoryEntity{
    @PrimaryGeneratedColumn()
    public id!: number;

    @Column()
    public userid: number;

    @Column({type: 'varchar', length: 16})
    public symbol: string;
    @Column({type: 'float', unsigned: true})
    public price: number;
    @Column({type: 'float', unsigned: true})
    public amount: number;

    @Column({type: 'varchar', length: 16})
    public action: "BUY" | "SELL" | string;
    
    @Column({type: 'datetime'})
    public datetime: Date;
    @Column({type: 'varchar', length: 16})
    public status: string;
    
    @Column({nullable: true})
    public raw?: string;

    @Column({nullable: true})
    public order_id: string;


    @Column({type: 'varchar', length: 8, nullable: true,})
    public trade_type: AutoTradeType;

    @Column({type: 'varchar', length: 32, nullable: true,})
    public exchange: string;
}
